Make -gtk-icontheme() use -gtk-icon-palette
authorMatthias Clasen <mclasen@redhat.com>
Wed, 13 Jan 2016 21:17:44 +0000 (16:17 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 13 Jan 2016 21:17:44 +0000 (16:17 -0500)
This makes it possible to recolor themed icons with -gtk-icon-palette,
regardless whether they are loaded by the theme or the application.

gtk/gtkcssimageicontheme.c
gtk/gtkcssimageiconthemeprivate.h

index 73c8a628a114e0d00c7e5972202be70909c92bfd..4451e1904aea3e1e75517390924cd67ebc1ff365 100644 (file)
@@ -27,6 +27,7 @@
 #include "gtkcssrgbavalueprivate.h"
 #include "gtksettingsprivate.h"
 #include "gtkstyleproviderprivate.h"
+#include "gtkiconthemeprivate.h"
 
 G_DEFINE_TYPE (GtkCssImageIconTheme, _gtk_css_image_icon_theme, GTK_TYPE_CSS_IMAGE)
 
@@ -66,7 +67,9 @@ gtk_css_image_icon_theme_draw (GtkCssImage        *image,
 
   pixbuf = gtk_icon_info_load_symbolic (icon_info,
                                         &icon_theme->color,
-                                        NULL, NULL, NULL,
+                                        &icon_theme->success,
+                                        &icon_theme->warning,
+                                        &icon_theme->error,
                                         NULL,
                                         &error);
   if (pixbuf == NULL)
@@ -139,7 +142,7 @@ gtk_css_image_icon_theme_compute (GtkCssImage             *image,
   copy->name = g_strdup (icon_theme->name);
   copy->icon_theme = gtk_css_icon_theme_value_get_icon_theme (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_THEME));
   copy->scale = _gtk_style_provider_private_get_scale (provider);
-  copy->color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
+  gtk_icon_theme_lookup_symbolic_colors (style, &copy->color, &copy->success, &copy->warning, &copy->error);
 
   return GTK_CSS_IMAGE (copy);
 }
index 5922146ea89fce0b8c0fc85e6864909353f9fb5c..07d1f8e4ff14cbb53d228d584f594ed019f57634 100644 (file)
@@ -41,6 +41,9 @@ struct _GtkCssImageIconTheme
 
   GtkIconTheme *icon_theme;
   GdkRGBA color;
+  GdkRGBA success;
+  GdkRGBA warning;
+  GdkRGBA error;
   gint scale;
   char *name;
 };